#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <stack>
#include <queue>
using namespace std;
bool IsPopOrder(vector<int>& pushV, vector<int>& popV) {
    stack<int> tmp;
    vector<int>::iterator it = popV.begin();
    vector<int>::iterator it2 = pushV.begin();
    while (it2 != pushV.end() && it != popV.end()) {
        if (tmp.empty())
            tmp.push(*(it2++));
        if (tmp.top() == *it)
        {
            tmp.pop();
            it++;
        }
        if (!tmp.empty())
            tmp.push(*(it2++));
    }
    return tmp.empty();
}
int main()
{
    vector<int> a = { 2,1,0 };
    vector<int> b = { 1,2,0 };
    cout << IsPopOrder(a, b);
}
